﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using mobliebo;
using System.Data.Common;
using System.Data;
using DataAccessClasses;


namespace mobliebo
{
     public class Registration
    {
        iDAC DAC = DACFactory.GetDAC();
        private string _Name = "";
        private string _Emailid = "";
        private string _password = "";
        private string _confirm_password = "";
        private long _mobileno = -99;
        private string _Address = "";
        private string _city = "";
        private string _state = "";
        private long _pincode = -99;
        private string _security_question = "";
        private string _Answer = "";
        public string Name
        {
            get
            {
                return _Name;
            }

            set
            {
                _Name = value;
            }
        }

        public string Emailid
        {
            get
            {
                return _Emailid;
            }

            set
            {
                _Emailid = value;
            }
        }
        public string password
        {
            get
            {
                return _password;
            }

            set
            {
                _password = value;
            }
        }
        public string confirm_password
        {
            get
            {
                return _confirm_password;
            }

            set
            {
                _confirm_password = value;
            }
        }


        public long mobileno
        {
            get
            {
                return _mobileno;
            }

            set
            {
                _mobileno = value;
            }
        }
        public string Address
        {
            get
            {
                return _Address;
            }

            set
            {
                _Address = value;
            }
        }
        public string city
        {
            get
            {
                return _city;
            }

            set
            {
                _city = value;
            }
        }
        public string state
        {
            get
            {
                return _state;
            }

            set
            {
                _state = value;
            }
        }
        public long pincode
        {
            get
            {
                return _pincode;
            }

            set
            {
                _pincode = value;
            }
        }
        public string security_question
        {
            get
            {
                return _security_question;
            }

            set
            {
                _security_question = value;
            }
        }
        public string Answer
        {
            get
            {
                return _Answer;
            }

            set
            {
                _Answer = value;
            }
        }
        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@Name", Name, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@Emailid", Emailid, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@password", password, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@confirm_password", confirm_password, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@mobileno", mobileno, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam5 = DAC.Parameter("@Address", Address, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam6 = DAC.Parameter("@city", city, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam7 = DAC.Parameter("@state", state, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam8 = DAC.Parameter("@pincode", pincode, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam9 = DAC.Parameter("@security_question", security_question, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam10 = DAC.Parameter("@Answer", Answer, DbType.AnsiString, ParameterDirection.Input);

                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5, dbparam6, dbparam7, dbparam8, dbparam9, dbparam10 };
                return DAC.Save("Registration_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords(string Name,string Emailid,string password,string confirm_password,long mobileno,string Address,string city,string state,long pincode,string security_question,string Answer,string andor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@Name", Name, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@Emailid", Emailid, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@password", password, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@confirm_password", confirm_password, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@mobileno", mobileno, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam5 = DAC.Parameter("@Address", Address, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam6 = DAC.Parameter("@city", city, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam7 = DAC.Parameter("@state", state, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam8 = DAC.Parameter("@pincode", pincode, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam9 = DAC.Parameter("@security_question", security_question, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam10 = DAC.Parameter("@Answer", Answer, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam11 = DAC.Parameter("@andor", andor, DbType.Boolean, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5, dbparam6, dbparam7, dbparam8, dbparam9, dbparam10,dbparam11};
                return DAC.Select("Registration_get", dbparamcall);
                DataTable dt1 = DAC.Select("Registration_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;
        }

    }
}
